<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" />
  <xsl:template match="/">

    <html>
      <head>
        <title>Deep Cloud Server</title>
        <link href="data/style.css" rel="stylesheet" type="text/css" />
      </head>
      <body>
        <!-- SIGN OUT BAR -->
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" class="textunderpic">
              Signed in as <span class="pagelink">
                <xsl:value-of select= "data/user/name" />
              </span>
              <span class="pagelinksep">|</span>
              <a href="/page/signin" class="pagelink">sign out</a>
            </td>
          </tr>
        </table>
        <table width="800" align="center" cellspacing="0" cellpadding="0">
          <tr>
            <td>
              <!-- AVATAR, TITLE, MENUBAR -->
              <table style="padding-top:20px;padding-bottom:20px;">
                <tr>
                  <td width="55" >
                    <a href="/">
                      <img src="data/avatar.jpg" width="48" height="48" style="border:thin none;"/>
                    </a>
                  </td>
                  <td width="480" >
                    <div class="title">Deep Cloud Server</div>
                    <xsl:for-each select="data/modules/module">
                      <!-- LINKS -->
                      <a>
                        <xsl:attribute name="href">
                          <xsl:value-of select= "name" />
                        </xsl:attribute>
                        <span class="pagelink">
                          <xsl:value-of select= "name" />
                        </span>
                      </a>
                      <xsl:if test="position()!=last()">
                        <span class="pagelinksep">|</span>
                      </xsl:if>
                    </xsl:for-each>
                  </td>
                  <!-- SEARCH -->
                  <td width="265" valign="bottom" align="right">
                    <form action="/search/" method="get" onblur="this.q.value = 'Search...'; this.q.style.color='#999999';">
                      <input name="q" type="text" value="Search..." class="searchbox" onfocus="if (this.value == 'Search...') this.value = ''; this.style.color='#000000';"/>
                      <button type="submit" class="searchbtn">Search</button>
                      <xsl:if test="data/user/isFiltered = 'True'">
                        <div style="padding-top:3;padding-left:20" align="left">
                          <a class="pagelink" href="#"  onclick="document.getElementById('datasenderform').target='';sendCommand('clearFilter', '/page/Organizer');">Clear search results</a>
                        </div>
                      </xsl:if>
                    </form>
                  </td>
                  <!-- end search -->
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </body>
    </html>

  </xsl:template>
</xsl:stylesheet>
